﻿@model MatTroi.vn.Models.MenuContent
@{
    ViewBag.Title = "Category";
    Layout = "~/Views/Shared/_LayoutHome.cshtml";
    <script src="@Url.Content("~/Scripts/jquery-1.6.3.min.js")" type="text/javascript"></script>
    @*<style src="@Url.Content("~/Content/Category.css")" type="text/css"></style>*@
    <link href="~/Content/Category.css" rel="stylesheet" />
    }

    <div class="ContentCategory">
        <div class="TieuDe">
                        @foreach (var dmb in Model.lstdm)
                        {
                            <img style="float:left!important;" src="~/Image/DanhMuc/@dmb.HinhAnh" /><h3>@dmb.TenDanhMuc</h3>
                        }
            
        </div>
        <hr />
        <div class="GioiThieu">
            <div class="TheLoai clearfix">

                <div class="tab_TheLoai">
                    <ul class="tab_nav clearfix">
                        @foreach (var dm in Model.listDanhMuc)
                        {
                            if (dm.TenDanhMuc.ToString().Length > 20)
                            {
                                <li><a href="#tab_@dm.ID_DanhMuc">@dm.TenDanhMuc.Substring(0,20)...</a></li>
                            }
                            else
                            {
                            <li><a href="#tab_@dm.ID_DanhMuc">@dm.TenDanhMuc</a></li> 
                            }


                        }
                    </ul>
                    <div class="clear"></div>
                    @for (int i =0; i <Model.listDanhMuc.Count();i++)
                    {
                    <ul id="tab_@Model.listDanhMuc[i].ID_DanhMuc" class="tab_content">
                        @foreach (var w in Model.GetWebDanhMuc(Model.listDanhMuc[i].ID_DanhMuc))
                        {
                            
                                <li style="list-style:none">
                                    <a style="text-decoration:none" target="_blank" href="@w.URL" onclick="">
                                        <div class="BoxWeb">
                                            <div class="BoxLstWeb">
                                                <div id="ImgWebTrangChu"><img class="ImgIconWeb" src="/Image/Website/@w.HinhAnh"></div>
                                                <div id="NameWebTrangChu">
                                                    <p class="TenWeb">@w.TenWebsite</p>
                                                    @if(w.MoTa.ToString().Length>110)
                                                    { 
                                                    <div id="MoTaWeb" class="TenWeb">@w.MoTa.Substring(0,110)...</div>
                                                    }
                                                    else
                                                    {<div id="MoTaWeb" class="TenWeb">@w.MoTa</div> }
                                                </div>
                                            </div>
                                            
                                        </div>
                                    </a>
                                </li>
                        }
                    </ul>
                    }
                </div>
            </div>
        </div>

    </div>
    <script type="text/javascript">
        $(document).ready(function () {
            tab();
        });
        function tab() {
            $('.tab_content').hide();
            $('.tab_content:first').show();
            $('.tab_nav li a:first').addClass('active');
            $('.tab_nav li a').click(function () {
                var id_content = $(this).attr("href");
                $('.tab_content').hide();
                $(id_content).fadeIn();
                $('.tab_nav li a').removeClass('active');
                $(this).addClass('active');
                return false;
            });

        }

    </script>
